﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Best.SmartCms.Dto;
using Best.SmartCms.Dto.Response;
using Best.SmartCms.Service;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;

namespace Best.SmartCms.Portal.Controllers
{
    /// <summary>
    /// 订单
    /// </summary>
    public class OrderController : Controller
    {
        private readonly IMemoryCache _cache;
        private readonly ProductService _productService;

        public OrderController(IMemoryCache memoryCache, ProductService productService)
        {
            _productService = productService;
            _cache = memoryCache;
        }


        public IActionResult Index(long id, int num = 1)
        {
            var model = _productService.ProductDetail(id);
            return View(model);
        }

        public IActionResult Order(OrderDto dto)
        {
            var data=new OrderDto();
            JsonResult result = new JsonResult(new {success = true, data = data});
            return result;
        }
    }
}